Repository navigation
Conversation
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
glours
left a comment
There was a problem hiding this comment.
Nothing blocking. A few remarks:
pkg/compose/model.go:84-89: an untagged reference thatParseNormalizedNamedrejects (uppercase repository, e.g.hf.co/Org/Model-GGUF) stays raw and gets no:latest. If the runner lists it ashf.co/Org/Model-GGUF:latest, it is still pulled on everyup. Same as before the PR, so not a regression, but thehf.co/Org/Model-GGUF:Q4_K_Mfixture is not taken from a real listing: do you know how the runner lists those? If it appends the tag, the fallback branch could do the same when the last segment has no:and no@.pkg/compose/model.go:81-82: "A reference that is not one of an image" reads oddly; something like "A reference that cannot be parsed as an image one (uppercase repository names are rejected) is left as it is" says the actual rule.pkg/compose/model_test.go:138:strings.Contains(log, "pull "+tt.model)would matchai/smollm2inside apull ai/smollm2:360Mline if a multi-model row is ever added. Fine as is with one model per row.
Not for this PR, but while in ensureModels: err = mdlAPI.PullModel(...) at model.go:68 assigns the err declared in the outer scope from the errgroup goroutines, which is a data race as soon as two models need a pull (go test -race with three unavailable models reports it). if err := ... or returning the call directly fixes it. The ListModels error at model.go:51 is also never checked (a failure means everything is pulled again).
2b4042e to
226a48e
Compare
|
Thanks, in 226a48e:
|
226a48e to
8c7a5de
Compare
|
Follow-up on the |
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟡 NEEDS ATTENTION
ensureModels compared the model of the compose file verbatim with the tags `docker model ls` lists, which are in full form (docker.io/ai/smollm2:latest). A model written ai/smollm2 never matched and was pulled on every `up`, even when it was already there. Both sides are now given their full form before they are compared, as image references are. Hugging Face models get the form the runner lists them under: resolved case-insensitively and listed as huggingface.co/org/model-gguf:latest for hf.co/Org/Model-GGUF (the tag keeps its case). Any other reference that cannot be parsed is compared as it is. Fixes docker#14531 Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
8c7a5de to
6a87c85
Compare
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
glours
left a comment
There was a problem hiding this comment.
Approving, nits only.
Checked the Hugging Face listing on Docker Model Runner v1.2.9: docker model pull hf.co/bartowski/SmolLM2-135M-Instruct-GGUF is listed as huggingface.co/bartowski/smollm2-135m-instruct-gguf:latest, the path is case-insensitive, and :Q4_K_M / :q4_k_m are listed as distinct tags. compose up with the model already present only configures it on this branch, where the base commit pulls it on every run (tried hf.co with and without a tag, a lower-case path, and the huggingface.co host).
Non-blocking:
- A bare name is not resolved the way the runner does:
smollm2is listed asdocker.io/ai/smollm2:latest, whilenormalizeModelReferencegivesdocker.io/library/smollm2:latest, so it is still pulled on everyup. Same as before the PR, fine to leave unless you want to special-case theai/namespace. HF.co/Org/Model-GGUF:Q4_K_MinTestNormalizeModelReference: the runner rejects an upper-case host (500), so that row describes an input that can't be pulled. Harmless.
| tag := "latest" | ||
| if i := strings.LastIndex(path, ":"); i > strings.LastIndex(path, "/") { | ||
| path, tag = path[:i], path[i+1:] | ||
| if tag == "" { | ||
| tag = "latest" | ||
| } | ||
| } |
There was a problem hiding this comment.
latest is set twice. Defaulting once after the optional split is equivalent (all TestNormalizeModelReference rows pass, including hf.co/Org/Model:) and drops a nested branch:
| tag := "latest" | |
| if i := strings.LastIndex(path, ":"); i > strings.LastIndex(path, "/") { | |
| path, tag = path[:i], path[i+1:] | |
| if tag == "" { | |
| tag = "latest" | |
| } | |
| } | |
| var tag string | |
| if i := strings.LastIndex(path, ":"); i > strings.LastIndex(path, "/") { | |
| path, tag = path[:i], path[i+1:] | |
| } | |
| if tag == "" { | |
| tag = "latest" | |
| } |
| "index.docker.io/ai/smollm2": "docker.io/ai/smollm2:latest", | ||
| "hf.co/Org/Model-GGUF": "huggingface.co/org/model-gguf:latest", | ||
| "HF.co/Org/Model-GGUF:Q4_K_M": "huggingface.co/org/model-gguf:Q4_K_M", | ||
| "huggingface.co/org/model": "huggingface.co/org/model:latest", |
There was a problem hiding this comment.
This row passes through the generic path too (it is already lower case), so it doesn't pin the huggingface.co host check. With a mixed-case path it does: dropping huggingface.co from the host test leaves the whole suite green today, and fails with this row (checked).
| "huggingface.co/org/model": "huggingface.co/org/model:latest", | |
| "huggingface.co/Org/Model": "huggingface.co/org/model:latest", |
What this PR does, in one sentence
Stops
docker compose upfrom pulling again a model written in short form (ai/smollm2) that the model runner already has.Context
Before pulling, Compose checks whether the model is already available by comparing the
modelof the compose file, verbatim, with the tagsdocker model lsreports. The runner lists them in full form (docker.io/ai/smollm2:latest), so only a model written exactly that way was recognized. A short name never matched, andPulling/Pulledshowed on everyupalong with a call to the model runner.What the PR brings
ai/smollm2,ai/smollm2:latest,docker.io/ai/smollm2anddocker.io/ai/smollm2:latestare the same model, and an available model is only configured, not pulled.hf.co/Org/Model-GGUFis listed ashuggingface.co/org/model-gguf:latest(other host, lower case; a tag such asQ4_K_Mkeeps its case), so that is the form compared.pull,configure, the*_MODELvariable) is unchanged: the model is passed as written.Fixes #14531
🤖 Generated with Claude Code